/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.psdk.remote;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.qihoo.psdk.util.a;
import com.qihoo.psdk.util.h;

public class QRemoteNetwork extends BroadcastReceiver {
    private static boolean a = true;
    private static String b = "";
    private static String c = "";
    private static boolean d = false;

    public void onReceive(Context paramContext, Intent paramIntent) {
        try {
            boolean bool1 = a.e(paramContext);
            h.a("QRemoteNetwork", "Network available: " + bool1);
            e.a(180000L);
            if (!(bool1))
                return;
            boolean bool2 = a.g(paramContext);
            h.a("QRemoteNetwork", "bWifi: " + bool2);
            h.a("QRemoteNetwork", "Before lastAccessType: " + b + ", lastSSID: " + c);
            d = false;
            String str;
            if (bool2) {
                e.a(300000L);
                str = a.h(paramContext);
                if (!("wifi".equals(b)))
                    d = true;
                else if (!(str.equals(c)))
                    d = true;
                b = "wifi";
                c = str;
            }
            else {
                str = a.f(paramContext);
                h.a("QRemoteNetwork", "networkType: " + str);
                if ((!(TextUtils.isEmpty(str))) && (str.toLowerCase().endsWith("wap"))) {
                    e.a(60000L);
                    if (!("wap".equals(b)))
                        d = true;
                    b = "wap";
                }
                else {
                    e.a(180000L);
                    if (!("net".equals(b)))
                        d = true;
                    b = "net";
                }
            }
            h.a("QRemoteNetwork", "After  lastAccessType: " + b + ", lastSSID: " + c);
            h.a("QRemoteNetwork", "bFirst: " + a + ", accessChange: " + d);
            if ((!(a)) && (d)) {
                h.a("QRemoteNetwork", "Call doSession, current check period: " + e.a());
                e.a(paramContext, true);
                return;
            }
            a = false;
        } catch (Exception localException) {
            h.a("QRemoteNetwork", localException);
        }
    }
}